Ext.define('Projeto.view.UserEdit', {
   extend: 'Ext.window.Window',
   alias: 'widget.useredit',

   title: 'Novo Usuário',
   id: 'windowUserEdit',
   layout: 'fit',
   autoShow: true,

   modal: true,
   width: 400,

   initComponent: function() {
       this.items = [{
            xtype: 'form',
            width: '100%',
            bodyPadding: 10,
            id: 'formUser',

            items: [{
                xtype: 'textfield',
                name: 'nome',
                fieldLabel: 'Nome',
                anchor: '100%'
            }, {
                xtype: 'textfield',
                name: 'email',
                fieldLabel: 'Email',
                anchor: '100%',
                vtype: 'email'
            }, {
            	xtype: 'combobox',
            	id: 'cboNivel',
            	name: 'nivelId',
            	fieldLabel: 'Nivel',
            	displayField: 'descricao',
            	valueField: 'id',
            	hiddenName: 'id',
            	store: 'Niveis',
            	editable: false,
            	forceSelection: true,
            	queryMode: 'local'
            },{
               xtype: 'textfield',
               inputType: 'password',
               name: 'senha',
               fieldLabel: 'Senha',
               anchor: '100%'
            },{
               xtype: 'textfield',
               inputType: 'password',
               name: 'confSenha',
               fieldLabel: 'Confirmar Senha',
               anchor: '100%'
            }],

            buttons: [
                {
                    text: 'Save',
                    action: 'save'
                },
                {
                    text: 'Cancel',
                    action: 'cancel',
                    scope: this,
                    handler: function() {
                        this.close();
                    }
                }
            ]
       }];

       this.callParent(arguments);
   }
});